package com.chixing.day07_abstract;

/**
 * 1. Account 作为父类：SavingAccount 与CreditAccount 有共有的属性与方法，所以将公共部分 抽离出来
 *                    放到另一个类中，减少了代码的【冗余性】
 *
 *    Account acc =  new Account();    error
 *    Account acc = new  SavingAccount()    ;
 */
public abstract class Account {
    // 存款
    public abstract void depoist();
    // 取款
    public void withdraw(){}
}

class SavingAccount extends Account{

    @Override
    public void depoist() {

    }
}

class CreditAccount extends Account{

    @Override
    public void depoist() {

    }
}

class LoanAccount extends Account{

    @Override
    public void depoist() {

    }
}




